<!DOCTYPE html>
<HTML>
<HEAD><meta name="viewport" content="width=device-width, initial-scale=1">
<Title>ViewPortControl</Title>
<link type='text/css' rel='Stylesheet' href="maxchartapi.css" />
</HEAD>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">

<p class="heading0">ChartDirector 7.0 (Java Edition)</p>
<p class="heading1">ViewPortControl</p>
<hr class="separator">
<div class="content">
The ViewPortControl is a SWING control to let the user visualize and manipulate the viewport managed by the <a href="ChartViewer.htm">ChartViewer</a>. It is a subclass of the JLabel control.<br><br>
In typical usage, the ViewPortControl displays an "overall chart" that shows the full data range, and connects to the ChartViewer using <a href="ViewPortControl.setViewer.htm">ViewPortControl.setViewer</a>. It can then include a rectangle on the overall chart to represent the viewport in the ChartViewer. The region outside the rectangle can be dimmed out to highlight the viewport region. If the viewport is changed (such as if the user uses the mouse wheel to zoom in the chart), the rectangle will update automatically.<br><br>
To manipulate the viewport, the user can drag the rectangle to move the viewport (equivalent to scrolling). The user can also resize the viewport by dragging the border of the rectangle (equivalent to zooming), or drag a new rectangular region on the overall chart to be used as the new viewport, or click on a point on the chart to center the viewport at that point.
<br><br>
<div style="width:100%;box-sizing:border-box;">
<table border="1" cellpadding="5" cellspacing="0" width="100%"> 
<tr>
<th width="19%">Method</th><th width="19%">Inherited</th><th>Description</th>
</tr>
<tr>
<td><a href="ViewPortControl.setChart.htm">setChart</a></td><td>(Self)</td><td>Sets a <a href="BaseChart.htm">BaseChart</a> object for displaying in the control. The chart usually is an overall chart that includes the full data range.</td></tr><tr><td><a href="ViewPortControl.getChart.htm">getChart</a></td><td>(Self)</td><td>Gets the <a href="BaseChart.htm">BaseChart</a> object provided by the previous <a href="ViewPortControl.setChart.htm">ViewPortControl.setChart</a> method call.</td></tr><tr><td><a href="ViewPortControl.setViewer.htm">setViewer</a></td><td>(Self)</td><td>Associates a <a href="ChartViewer.htm">ChartViewer</a> object with this ViewPortControl object.</td></tr><tr><td><a href="ViewPortControl.getViewer.htm">getViewer</a></td><td>(Self)</td><td>Gets the <a href="ChartViewer.htm">ChartViewer</a> object provided by the previous <a href="ViewPortControl.setViewer.htm">ViewPortControl.setViewer</a> method call.</td></tr><tr><td><a href="ViewPortControl.setDragInsideToMove.htm">setDragInsideToMove</a></td><td>(Self)</td><td>Enables or disables  dragging inside the viewport to move it.</td></tr><tr><td><a href="ViewPortControl.getDragInsideToMove.htm">getDragInsideToMove</a></td><td>(Self)</td><td>Checks if  dragging inside the viewport to move it is enabled or disabled.</td></tr><tr><td><a href="ViewPortControl.setDragBorderToResize.htm">setDragBorderToResize</a></td><td>(Self)</td><td>Enables or disables  dragging the viewport border to resize it.</td></tr><tr><td><a href="ViewPortControl.getDragBorderToResize.htm">getDragBorderToResize</a></td><td>(Self)</td><td>Checks if  dragging the viewport border to resize it is enabled or disabled.</td></tr><tr><td><a href="ViewPortControl.setDragOutsideToSelect.htm">setDragOutsideToSelect</a></td><td>(Self)</td><td>Enables or disables  dragging outside the viewport to select a new viewport.</td></tr><tr><td><a href="ViewPortControl.getDragOutsideToSelect.htm">getDragOutsideToSelect</a></td><td>(Self)</td><td>Checks if  dragging outside the viewport to select a new viewport is enabled or disabled.</td></tr><tr><td><a href="ViewPortControl.setClickToCenter.htm">setClickToCenter</a></td><td>(Self)</td><td>Enables or disables  centering the viewport at the clicked point.</td></tr><tr><td><a href="ViewPortControl.getClickToCenter.htm">getClickToCenter</a></td><td>(Self)</td><td>Checks if  centering the viewport at the clicked point is enabled or disabled.</td></tr><tr><td><a href="ViewPortControl.setViewPortExternalColor.htm">setViewPortExternalColor</a></td><td>(Self)</td><td>Sets the  fill color for the region outside the viewport.</td></tr><tr><td><a href="ViewPortControl.getViewPortExternalColor.htm">getViewPortExternalColor</a></td><td>(Self)</td><td>Gets the  fill color for the region outside the viewport.</td></tr><tr><td><a href="ViewPortControl.setViewPortBorderColor.htm">setViewPortBorderColor</a></td><td>(Self)</td><td>Sets the  viewport border color.</td></tr><tr><td><a href="ViewPortControl.getViewPortBorderColor.htm">getViewPortBorderColor</a></td><td>(Self)</td><td>Gets the  viewport border color.</td></tr><tr><td><a href="ViewPortControl.setViewPortBorderWidth.htm">setViewPortBorderWidth</a></td><td>(Self)</td><td>Sets the  viewport border width.</td></tr><tr><td><a href="ViewPortControl.getViewPortBorderWidth.htm">getViewPortBorderWidth</a></td><td>(Self)</td><td>Gets the  viewport border width.</td></tr><tr><td><a href="ViewPortControl.setViewPortFillColor.htm">setViewPortFillColor</a></td><td>(Self)</td><td>Sets the  fill color for the region inside the viewport.</td></tr><tr><td><a href="ViewPortControl.getViewPortFillColor.htm">getViewPortFillColor</a></td><td>(Self)</td><td>Gets the  fill color for the region inside the viewport.</td></tr><tr><td><a href="ViewPortControl.setSelectionBorderColor.htm">setSelectionBorderColor</a></td><td>(Self)</td><td>Sets the  border color of the selection box.</td></tr><tr><td><a href="ViewPortControl.getSelectionBorderColor.htm">getSelectionBorderColor</a></td><td>(Self)</td><td>Gets the  border color of the selection box.</td></tr><tr><td><a href="ViewPortControl.setSelectionBorderWidth.htm">setSelectionBorderWidth</a></td><td>(Self)</td><td>Sets the  border width of the selection box.</td></tr><tr><td><a href="ViewPortControl.getSelectionBorderWidth.htm">getSelectionBorderWidth</a></td><td>(Self)</td><td>Gets the  border width of the selection box.</td></tr><tr><td><a href="ViewPortControl.setCursor.htm">setCursor</a></td><td>(Self)</td><td>Sets the mouse cursors to be used at various parts of the control.</td></tr><tr><td><a href="ViewPortControl.setMouseMargin.htm">setMouseMargin</a></td><td>(Self)</td><td>Sets the margin around the viewport border for mouse drag.</td></tr><tr><td><a href="ViewPortControl.updateDisplay.htm">updateDisplay</a></td><td>(Self)</td><td>Updates the display.</td></tr><tr><td colspan="3" bgColor="#cccccc">Note: Methods inherited from JLabel are omitted.</td></tr>
</tr>
</table>
</div>

</div>
<hr class="separator"><div class="copyright">&copy; 2022 Advanced Software Engineering Limited. All rights reserved.</div>
</body>
</HTML>
